package com.flyee.communicate.local{
	
	import com.flyee.communicate.AbstractHandler;
	import com.flyee.communicate.Communicate;
	import com.flyee.io.local.ConnectBean;
	import com.flyee.io.local.ConnectFactory;
	import com.flyee.utils.MyLog;

	public class LocalCommunicate extends AbstractHandler implements Communicate{
		
		private var connect : ConnectBean;
		
		public function LocalCommunicate(fn:Function){
			super(fn);
			connect = ConnectFactory.getBean("local");
			connect.registerCommunicate("local", this);
		}
		
		public function request(...args):void{
			connect.sendMessage("local", args[0]);
		}
		
		public function response(...args):void{
			MyLog.debug("get return message : " + args[0]);	
			//connect.cancelCommunicate("local");
		}
		
	}
}